
// 获取地址栏里的参数
export function getUrlParamsKey(key) {
    let getHref = location.href; //取得整个地址栏
    let num = getHref.indexOf("?")
    getHref = getHref.substr(num + 1); //取得所有参数 stringvar.substr(start [, length ]

    let arr = getHref.split("&"); //各个参数放到数组里
    let paramsJson = {}
    for (let i = 0; i < arr.length; i++) {
        num = arr[i].indexOf("=");
        if (num > 0) {
            let name = arr[i].substring(0, num);
            let value = arr[i].substr(num + 1);
            // this[name] = value;
            paramsJson[name] = value;
        }
    }
    let getKey =  paramsJson[key] || ''; 
    // if(key == 'uuid' && getKey){
    //     let searchStr = '';
    //     delete paramsJson['uuid']
    //     for(let item in paramsJson){
    //         if(searchStr!=''){
    //             searchStr+='&';
    //         }
    //         searchStr+=`${item}=${paramsJson[item]}` 
    //     }
    //     location.href = searchStr;    
    // }
    return getKey

}